package com.scau.database.controller.aftersalesstaff;

import com.scau.database.entity.aftersale.manage.ExchangeGoodsVO;
import com.scau.database.entity.aftersale.manage.RepairGoodsVO;
import com.scau.database.entity.aftersale.manage.ResponseReturnGoodsVO;
import com.scau.database.entity.aftersale.manage.ReturnGoodsVO;
import com.scau.database.exception.APIException;
import com.scau.database.service.aftersalesstaff.AfterSalesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @ClassName: AfterSalesController
 * @Description: TODO 售后控制层
 * @Author: sunslikes
 * @Date: 2020/6/23 19:36
 * @Version: 1.0
 */

@RestController
@RequestMapping("/api/aftersales")
public class AfterSalesController {

    @Autowired
    private AfterSalesService service;

    @PostMapping("/returngoods")
    public ResponseReturnGoodsVO returnGoods(@RequestBody @Valid ReturnGoodsVO goodsVO) {
        return service.returnGoods(goodsVO);
    }

    @PostMapping("/exchangegoods")
    public String exchangeGoods(@RequestBody @Valid ExchangeGoodsVO goodsVO) {
        return service.exchangeGoods(goodsVO);
    }

    @PostMapping("/repairgoods")
    public String repairgoods(@RequestBody @Valid RepairGoodsVO goodsVO) {
        return service.repairGoods(goodsVO);
    }


}
